using Sandia.MVCFramework.Data;
using System;
using System.Collections.Generic;
using System.Text;

namespace Sandia.MVCFramework.Common
{
    /// <summary>
    /// Interface to be implemented by classes that are subscribers to
    /// published data
    /// </summary>
    public interface ISubscriber: IDisposable
    {
        /// <summary>
        /// The list of IData types that this subscriber would like to subscribe
        /// to.
        /// </summary>
        IList<Type> DesiredSubscriptions
        {
            get;
        }

        /// <summary>
        /// Method for receiving and handling published data
        /// </summary>
        /// <param name="dataPacket">
        /// The data packet that was published.
        /// </param>
        void HandlePublishedData(
            DataPacket dataPacket);

        /// <summary>
        /// Whether or not this object is disposed. 
        /// </summary>
        bool IsDisposed
        {
            get;
        }

        /// <summary>
        /// To be called sometime during disposal
        /// </summary>
        event EventHandler Disposed;

    }
}
